import wx
import math
import os

class baseNode(object):
	def __init__(self):
		#paramtypes saves the type of data de node has
		#the names of the vars for each type
		#self.guidata = {"title": "Base Node", 'paramtypes': ['char', int'], 'char':['key'], 'int':['value1,value2]}
		self.guidata = {"title": "Base Node", 'paramtypes': []}
		#dictionary of values
		#self.data = {'char':{'key':'k'}, 'int':{'value1':1, 'value2':3}}
		self.data = {}
	def setValue(self,typevar, key, keyvalue):
		if typevar not in self.guidata['paramtypes']:
			self.guidata['paramtypes'].append(typevar)
			self.data[typevar] = {}
			self.guidata[typevar] = []
		if key not in self.guidata[typevar]:
			self.guidata[typevar].append(key)
		self.data[typevar][key] = keyvalue
	def setGuiData(self, data):
		self.guidata = data		
	def getParamTypes(self):
		return self.guidata['paramtypes']
	def getParamNames(self, typeVar):
		return self.guidata[typeVar]
	def getParam(self, typeVar, var):
		return self.data[typeVar][var]
	def getParams(self, typeVar):
		if typeVar in self.guidata['paramtypes']:
			return self.data[typeVar]


node = baseNode()
dic = {"title": "test Node", 'paramtypes': []}
node.setGuiData(dic)
node.setValue('char','key','e')
node.setValue('char','key2','e')
node.setValue('int','num',1)
print(node.getParamTypes())
for par in node.getParamTypes():
	for var in node.getParamNames(par):
		print(node.getParam(par,var))
